/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package VO;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author langeblanc
 */
@Entity
@Table(name = "PULGA")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "CPulga.findAll", query = "SELECT c FROM CPulga c"),
    @NamedQuery(name = "CPulga.findByCodPulga", query = "SELECT c FROM CPulga c WHERE c.codPulga = :codPulga")})
public class CPulga implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @Column(name = "COD_PULGA")
    private Integer codPulga;
    @JoinColumn(name = "COD_PERRO", referencedColumnName = "COD_PERRO")
    @ManyToOne
    private CPerro codPerro;

    public CPulga() {
    }

    public CPulga(Integer codPulga) {
        this.codPulga = codPulga;
    }

    public Integer getCodPulga() {
        return codPulga;
    }

    public void setCodPulga(Integer codPulga) {
        this.codPulga = codPulga;
    }

    public CPerro getCodPerro() {
        return codPerro;
    }

    public void setCodPerro(CPerro codPerro) {
        this.codPerro = codPerro;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (codPulga != null ? codPulga.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof CPulga)) {
            return false;
        }
        CPulga other = (CPulga) object;
        if ((this.codPulga == null && other.codPulga != null) || (this.codPulga != null && !this.codPulga.equals(other.codPulga))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "VO.CPulga[ codPulga=" + codPulga + " ]";
    }
    
}
